<%-- 
    Document   : TipoLancamentoPesq
    Created on : 23/06/2010, 22:28:20
    Author     : WAND
--%>

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <title>Tipo Lançamento</title>
        <%@include file="../../_include/header.jsp"%>
    </head>
    <style type="text/css"><!--@import url("../../_css/style.css");--></style>
    <body>
        <f:view>
            <t:saveState id="_bean" value="#{TipoLancamentoBean}" />
            <a4j:form id="tipoLancamentoPesq" status="modalStatus">
                <rich:simpleTogglePanel switchType="client" label="Tipo Lançamento" width="95%">
                    <t:panelGrid columns="6">
                        <t:column><h:outputLabel value="Descrição" for="descricaoPesq"/></t:column>
                        <t:column>
                            <h:inputText value="#{TipoLancamentoBean.descricaoPesq}" id="descricaoPesq" maxlength="40" style="width:200px;"/>
                        </t:column>

                        <t:column><h:outputLabel value="Despesa" for="despesaPesq"/></t:column>
                        <t:column>
                            <h:selectBooleanCheckbox value="#{TipoLancamentoBean.despesaPesq}" id="despesaPesq" style="width:20px;"/>
                        </t:column>

                        <t:column><h:outputLabel value="Receita" for="receitaPesq"/></t:column>
                        <t:column>
                            <h:selectBooleanCheckbox value="#{TipoLancamentoBean.receitaPesq}" id="receitaPesq" style="width:20px;"/>
                        </t:column>

                        <t:column><h:commandButton value="Pesquisar" action="#{TipoLancamentoBean.pesquisar}"/>&nbsp;&nbsp;</t:column>
                        <t:column><h:commandButton value="Novo" action="#{TipoLancamentoBean.incluir}"/>&nbsp;&nbsp;</t:column>
                        <t:column>&nbsp;</t:column>
                        <t:column>&nbsp;</t:column>
                    </t:panelGrid>
                </rich:simpleTogglePanel>
                <rich:dataTable id="tblTipoLancamento" value="#{TipoLancamentoBean.listaTipoLancamento}" var="list"
                                width="95%" columnClasses="center" rows="50" reRender="ds">
                    <rich:column width="40px">
                        <f:facet name="header">
                            <h:outputText value="Cód"/>
                        </f:facet>
                        <h:outputText value="#{list.id}"/>
                    </rich:column>
                    <rich:column filterBy="#{list.descricao}" filterEvent="onkeyup" breakBefore="false" sortBy="#{list.descricao}">
                        <f:facet name="header">
                            <h:outputText value="Descrição"/>
                        </f:facet>
                        <h:outputText value="#{list.descricao}"/>
                    </rich:column>
                    <rich:column filterBy="#{list.despesa}" filterEvent="onkeyup" breakBefore="false" sortBy="#{list.despesa}">
                        <f:facet name="header">
                            <h:outputText value="Despesa"/>
                        </f:facet>
                        <h:graphicImage url="../../_images/passed.gif" rendered="#{list.despesa}"/>
                        <h:graphicImage url="../../_images/error.gif" rendered="#{!list.despesa}"/>
                    </rich:column>
                    <rich:column filterBy="#{list.receita}" filterEvent="onkeyup" breakBefore="false" sortBy="#{list.receita}">
                        <f:facet name="header">
                            <h:outputText value="Receita"/>
                        </f:facet>
                        <h:graphicImage url="../../_images/passed.gif" rendered="#{list.receita}"/>
                        <h:graphicImage url="../../_images/error.gif" rendered="#{!list.receita}"/>
                    </rich:column>
                    <rich:column width="50px">
                        <f:facet name="header">
                            <h:outputText value="Ações"/>
                        </f:facet>
                        <h:commandButton image="../../_images/btn_alterar.gif" title="Alterar Registro" binding="#{TipoLancamentoBean.btnAlterar}" value="#{list.id}" action="#{TipoLancamentoBean.alterar}"/>&nbsp;
                        <h:commandButton image="../../_images/btn_excluir.gif" title="Exluir Registro" binding="#{TipoLancamentoBean.btnExcluir}" value="#{list.id}" action="#{TipoLancamentoBean.excluir}"/>
                    </rich:column>

                    <f:facet name="footer">
                        <rich:datascroller id="ds"></rich:datascroller>
                    </f:facet>

                </rich:dataTable>
                <a4j:status id="modalStatus" onstart="Richfaces.showModalPanel('ajaxLoadingModalBox')"
                onstop="Richfaces.hideModalPanel('ajaxLoadingModalBox')" />
            </a4j:form>
        </f:view>
    </body>
</html>